var form = layui.form;
var $ = layui.jquery;
var layer = layui.layer;
var element = layui.element;
var laypage= layui.laypage;
function formSubmit(url,submit,dataType,func){
	form.on(submit,function(data){
	ajax(url,data.field,dataType,func);
	})
}

function ajax(url,field,dataType,func){
	$.ajax({
		url:url,
		type:"post",
		data:field,
		dataType:dataType,
		success:func
		
	})
}
function close(){
	var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
    parent.layer.close(index);//关闭窗口
}

function setPageInfo(elem,count,curr,limit,jump){ //分頁
	
	laypage.render({
		elem:elem,
		count:count,
		curr:curr,
		limit:limit,
		limits:[5,10,20,30,40],
		layout:	['count','prev', 'page', 'next','limit','refresh','skip'],
		jump:jump,
	})
}
